Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Refactor] Barcode scanning #8658

Merged
merged 24 commits into from
Dec 16, 2024

Conversation

SchrodingersGat
Copy link
Member

@SchrodingersGat SchrodingersGat commented Dec 12, 2024

Refactoring implementation of custom supplier barcode scanning:

Headline Items

  • Code refactoring / simplification
  • Allow greater introspection of data from generic "scan" endpoint
  • Improved error handling for "check in items" handler
  • Smoother integration with the app
  • Allow client to explicitly choose not to auto-receive, but allow confirmation of extracted information

Ref: inventree/inventree-app#577

One of the major improvements here is that a supplier barcode plugin will return partial data on a generic "scan" request. Previously it would only return information responding to a supplier part.

However, suppliers will send packing lists with other information (purchase order number is a good example). So now you can scan that code in the app, the supplier barcode will recognize and return any field which is provided, and allows the app to navigate to the purchase order detail page.

@SchrodingersGat SchrodingersGat added enhancement This is an suggested enhancement or new feature barcode Barcode scanning and integration plugin Plugin ecosystem api Relates to the API refactor labels Dec 12, 2024
@SchrodingersGat SchrodingersGat added this to the 0.17.0 milestone Dec 12, 2024
Copy link

netlify bot commented Dec 12, 2024

Deploy Preview for inventree-web-pui-preview canceled.

Name Link
🔨 Latest commit a82dc4a
🔍 Latest deploy log https://app.netlify.com/sites/inventree-web-pui-preview/deploys/6760217d18483f0008c4e8e1

Copy link

codecov bot commented Dec 12, 2024

Codecov Report

Attention: Patch coverage is 68.97810% with 85 lines in your changes missing coverage. Please review.

Project coverage is 84.04%. Comparing base (34b70d0) to head (a82dc4a).
Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
...c/backend/InvenTree/plugin/base/barcodes/mixins.py 69.27% 51 Missing ⚠️
src/backend/InvenTree/plugin/base/barcodes/api.py 52.94% 8 Missing ⚠️
src/backend/InvenTree/InvenTree/models.py 12.50% 7 Missing ⚠️
src/backend/InvenTree/plugin/base/locate/api.py 25.00% 6 Missing ⚠️
src/backend/InvenTree/report/models.py 0.00% 4 Missing ⚠️
src/backend/InvenTree/stock/models.py 40.00% 3 Missing ⚠️
src/backend/InvenTree/plugin/base/action/api.py 71.42% 2 Missing ⚠️
...kend/InvenTree/plugin/base/barcodes/serializers.py 77.77% 2 Missing ⚠️
src/backend/InvenTree/common/icons.py 50.00% 1 Missing ⚠️
src/backend/InvenTree/order/models.py 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8658      +/-   ##
==========================================
- Coverage   84.59%   84.04%   -0.55%     
==========================================
  Files        1194     1195       +1     
  Lines       54353    55348     +995     
  Branches     2055     2057       +2     
==========================================
+ Hits        45980    46518     +538     
- Misses       7866     8320     +454     
- Partials      507      510       +3     
Flag Coverage Δ
backend 86.05% <81.60%> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ius
Copy link

ius commented Dec 16, 2024

This looks pretty useful!

It (nearly) covers a use case I've been wanting to suggest: returning StockItems for 'minimized' EIGP 114.2018 barcodes containing {supplier_order_number, supplier_part_no[, qty]}. Would enable printing tiny datamatrix barcodes which resolve to a StockItem without relying on StockItem ids.

@SchrodingersGat SchrodingersGat merged commit d42435c into inventree:master Dec 16, 2024
27 checks passed
@SchrodingersGat SchrodingersGat deleted the barcode-scanning branch December 16, 2024 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Relates to the API barcode Barcode scanning and integration enhancement This is an suggested enhancement or new feature plugin Plugin ecosystem refactor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants